package com.oig.sys.workflow.entity;

import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import org.springframework.data.annotation.CreatedBy;
import org.springframework.data.annotation.CreatedDate;
import org.springframework.data.annotation.LastModifiedBy;
import org.springframework.data.annotation.LastModifiedDate;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.EntityListeners;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.persistence.Version;
import java.io.Serializable;


/**
 * @author wuxl
 * 自动化规则配置表
 */
@Getter
@Setter
@ToString
@Entity
@Table(name = "tb_auto_rule")
@EntityListeners({AuditingEntityListener.class})
public class TbAutoRule implements Serializable {

	/**
	 */
	@Id
	@GeneratedValue(strategy=GenerationType.IDENTITY)
	@Column(name = "id", nullable = false)
	private Integer id;

	/**
	 */
	@Column(name = "auto_rule_name")
	private String autoRuleName;

	/**
	 * 监听对象id
	 */
	@Column(name = "listener_object_id")
	private Integer listenerObjectId;
	/**
	 * 监听对象，管理上的对象名称
	 */
	@Column(name = "listener_object_name")
	private String listenerObjectName;
	/**
	 * 监听业务单据类型
	 */
	@Column(name = "relation_type")
	private String relationType;


	/**
	 * 监听事件id
	 */
	@Column(name = "listener_event_id")
	private Integer listenerEventId;

	/**
	 * 监听事件名称，管理上的名称
	 */
	@Column(name = "listener_event_name")
	private String listenerEventName;

	/**
	 * 监听表
	 */
	@Column(name = "listener_table_name")
	private String listenerTableName;

	/**
	 * 监听操作
	 */
	@Column(name = "listener_event_operation")
	private String listenerEventOperation;

	/**
	 * 监听业务单据类型
	 */
	@Column(name = "relation_id_column")
	private String relationIdColumn;
	/**
	 * 监听变更配置
	 */
	@Column(name = "listener_update_cfg")
	private String listenerUpdateCfg ;
	/**
	 * 状态
	 */
	@Column(name = "status")
	private String status;

	/**
	 * 是否启用 0-未启用 1-启用
	 */
	@Column(name = "enable")
	private String enable;

	/**
	 */
	@CreatedBy
	@Column(name = "create_user_id")
	private Integer createUserId;

	/**
	 */
	@Column(name = "create_user_name")
	private String createUserName;

	/**
	 */
	@CreatedDate
	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "create_time")
	private java.util.Date createTime;

	/**
	 */
	@LastModifiedBy
	@Column(name = "last_update_id")
	private Integer lastUpdateId;

	/**
	 */
	@Column(name = "last_update_name")
	private String lastUpdateName;

	/**
	 */
	@LastModifiedDate
	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "last_update_time")
	private java.util.Date lastUpdateTime;

	/**
	 */
	@Version
	@Column(name = "version")
	private Integer version;

	/**
	 */
	@Column(name = "tenant_id")
	private Integer tenantId;

	/**
	 */
	@Column(name = "tenant_name")
	private String tenantName;
}
